#ifndef __GRAVESTONE_BLOCK_H__
#define __GRAVESTONE_BLOCK_H__

#include "Block.hpp"

namespace PocketSurvival
{
    // 墓碑
    class GravestoneBlock : public Block
    {
    public:
        static constexpr int32_t Index()
        {
            return 189;
        }
        virtual int32_t getIndex() override; 
        virtual const std::string &getBlockName() override;

        virtual void getCreativeValues(std::vector<int32_t> &blockVec) override;
        virtual void getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues) override;
    
        virtual BlockPlacementData getPlacementValue(ComponentMiner *componentMiner, int32_t value, const TerrainRaycastResult &raycastResult) override;
        virtual const std::vector<BoundingBox> &getCustomCollisionBoxes(int32_t value) override;

		static inline int32_t GetRotation(int32_t data);
		static inline int32_t SetRotation(int32_t data, int32_t rotation);
		static inline int32_t GetVariant(int32_t data);
		static inline int32_t SetVariant(int32_t data, int32_t variant);
    };

	inline int32_t GravestoneBlock::GetRotation(int32_t data)
	{
		return (data & 8) >> 3;
	}
	inline int32_t GravestoneBlock::SetRotation(int32_t data, int32_t rotation)
	{
		return (data & -9) | ((rotation << 3) & 8);
	}
	inline int32_t GravestoneBlock::GetVariant(int32_t data)
	{
		return data & 7;
	}
	inline int32_t GravestoneBlock::SetVariant(int32_t data, int32_t variant)
	{
		return (data & -8) | (variant & 7);
	}

} // namespace PocketSurvival


#endif
